<?php
if(!defined('EMLOG_ROOT')) {exit('error!');}
function callback_init(){
	$DB = MySql::getInstance();
	$check_table_exist = $DB->query('SHOW TABLES LIKE "'.DB_PREFIX.'wm_serial_number"');
	if($DB->num_rows($check_table_exist) == 0){// 新建数据表
		$dbcharset = 'utf8mb4';
		$type = 'MYISAM';
		$add = $DB->getMysqlVersion() > '4.1' ? "ENGINE=".$type." DEFAULT CHARSET=".$dbcharset.";":"TYPE=".$type.";";
		$sql = "CREATE TABLE  `".DB_PREFIX."wm_serial_number` (
		`id` mediumint(8) unsigned NOT NULL auto_increment,
		`serialNumber` longtext NOT NULL,
		`state` int(20) NOT NULL default '0',
		`useTime` bigint(20) NOT NULL default '0',
		`type` int(10) NOT NULL default '0',
		`exData` longtext NOT NULL,
		PRIMARY KEY  (`id`)
)".$add;
		$DB->query($sql);
	}
}

function callback_rm(){
	$DB = MySql::getInstance();
	$query = $DB->query("DROP TABLE IF EXISTS ".DB_PREFIX."wm_serial_number");
}
?>
